package com.example.service;

import com.example.entity.FLTrainingRound;
import com.example.mapper.FLTrainingRoundMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * ClassName: FLTrainingRound
 * Package: com.example.service
 * Description:
 *
 * @Author achb
 * @Create 2025/3/30 17:15
 * @Version 1.0
 */
@Service

public class FLTrainingRoundService {
    // 正确注入方式
    @Resource
    private FLTrainingRoundMapper flTrainingRoundMapper;

    @Transactional
    public boolean batchInsert(List<FLTrainingRound> rounds) {
        int affectedRows = flTrainingRoundMapper.batchInsert(rounds);
        // 检查插入的行数是否大于 0，判断是否成功
        return affectedRows > 0;
    }
}
